package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.Category;
import com.ruoyi.system.api.factory.RemoteCategoryFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//contextId需要唯一，ServiceNameConstants服务名，fallbackFactory服务调用失败的回调
@FeignClient(contextId = "categoryService", value = ServiceNameConstants.CATEGORY_SERVICE, fallbackFactory = RemoteCategoryFallbackFactory.class)
public interface CategoryService {

    @GetMapping(value = "/category/{id}")
    public Category getInfo(@PathVariable("id") Long id);

}
